import { IParam, EntityBase } from "@/core";
import { IIBIZOrder } from './interface/i-ibiz-order';
import IBIZOrderKeys from './ibiz-order-keys';

/**
 * 订单基类
 * 基于template/src/api/{{appEntities}}/{{appEntities}}-base.ts.hbs生成  
 *
 * @export
 * @abstract
 * @class IBIZOrderBase
 * @extends { EntityBase }
 * @implements { IIBIZOrder }
 */
export abstract class IBIZOrderBase extends EntityBase implements IIBIZOrder {
	/**
	 * 实体名称
	 *
	 * @readonly
	 * @type {string}
	 * @memberof IBIZOrderBase
	 */
	get srfdename(): string {
		return 'IBIZORDER';
	}

	/**
     * 当前实体所有属性
     *
     * @protected
     * @type {string[]}
     * @memberof IBIZOrderBase
     */
    protected get keys(): string[] {
        return IBIZOrderKeys;
    }

	/**
	 * Creates an instance of ConstactOppoBase.
	 * @param {*} [data]
	 * @memberof IBIZOrderBase
	 */
	constructor(data?: any) {
		super();
		this.setData(data);
	}

	/**
	 * 图片
	 **/
	tp?: any;
	
	/**
	 * 订单结束时间
	 **/
	endtime?: any;
	
	/**
	 * 工作流状态
	 **/
	wfstate?: any;
	
	/**
	 * 建立时间
	 **/
	createdate?: any;
	
	/**
	 * 审批意见
	 **/
	opinion?: any;
	
	/**
	 * 更新时间
	 **/
	updatedate?: any;
	
	/**
	 * 订单类型
	 **/
	ordertype?: any;
	
	/**
	 * 明细数
	 **/
	detailnum?: any;
	
	/**
	 * 工作流实例
	 **/
	wfinstanceid?: any;
	
	/**
	 * 总计
	 **/
	amount?: any;
	
	/**
	 * 订单编号
	 **/
	orderuid?: any;
	
	get srfkey(): string {
		return this.ibizorderid;
	}

	set srfkey(val: string) {
		this.ibizorderid = val;
	}

	/**
	 * 订单标识
	 **/
	ibizorderid?: any;
	
	/**
	 * 订单状态
	 **/
	orderstate?: any;
	
	/**
	 * 订单开始时间
	 **/
	starttime?: any;
	
	/**
	 * 更新人
	 **/
	updateman?: any;
	
	/**
	 * 工作流步骤
	 **/
	wfstep?: any;
	
	/**
	 * 建立人
	 **/
	createman?: any;
	
	get srfmajortext(): string {
		return this.ibizordername;
	}

	set srfmajortext(val: string) {
		this.ibizordername = val;
	}
	/**
	 * 订单名称
	 **/
	ibizordername?: any;
	
	/**
	 * 订单时间
	 **/
	ordertime?: any;
	
	/**
	 * 备注
	 **/
	memo?: any;
	
	/**
	 * 客户名称
	 **/
	ibizcustomername?: any;
	
	/**
	 * 客户标识
	 **/
	ibizcustomerid?: any;
	

	/**
	 * 重置实体数据
	 *
	 * @param {IParam} [data={}]
	 * @memberof IBIZOrderBase
	 */
	reset(data: IParam = {}): void {
		super.reset(data);
		this.ibizorderid = data.ibizorderid || data.srfkey;
		this.ibizordername = data.ibizordername || data.srfmajortext;
	}
}